<?php 
session_start();include "conn.php";
?>
<?php  include("admin.php");?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title> Bios 管理中心 </title>
<link href="../css/control.css" rel="stylesheet" type="text/css" />
</head>

<body>

 <script language="javascript">
function check_aid(aid){

document.getElementById("a1").style.display = "none";
document.getElementById("a2").style.display = "none";
document.getElementById("a3").style.display = "none";
document.getElementById("a4").style.display = "none";
document.getElementById("a5").style.display = "none";

document.getElementById(aid).style.display = "block";
}
</script>


<a name="top" id="top"></a>
<div id="all"><!--Wrap start //-->
<div id="main" class="clearfix"><!--main start //-->
<div id="top-1"><?php include_once('blog_top_btn.php');?>
</div>
<!--Content for  id "submenu" Goes Here //-->
<div id="submenu">
<?php include_once('blog_main_btn.php');?>
  </div>
 <!--Content for  id "contact" Goes Here //-->
 
 
 
 
 
 
 
  <script language="javascript">
function check(form){
if (form1.title.value=="")
{alert("請填寫 標題！");form1.title.focus();return false;}
}
</script>




<?php
//文件名。。。
$webname="news"; 
$linkname="blog-main"; 
?>

<?php 
$id=make_safe($_GET["id"]);

//echo $data;
$action=make_safe($_GET["action"]);
$value_images=make_safe($_GET["value_images"]);
$del_value=make_safe($_GET["del_value"]);
$BigClassName=make_safe($_POST["BigClassName"]);
$BigClassName2=make_safe($_POST["BigClassName2"]);
$BigClassName3=make_safe($_POST["BigClassName3"]);
$BigClassName4=make_safe($_POST["BigClassName4"]);
$BigClassName5=make_safe($_POST["BigClassName5"]);
$BigClassName6=make_safe($_POST["BigClassName6"]);

$enBigClassName=make_safe($_POST["enBigClassName"]);
$SmallClassName=make_safe($_POST["SmallClassName"]);
$enSmallClassName=make_safe($_POST["enSmallClassName"]);
$title=make_safe($_POST["title"]);
$tagcloud1=make_safe($_POST["tagcloud1"]);
$tagcloud2=make_safe($_POST["tagcloud2"]);
$tagcloud3=make_safe($_POST["tagcloud3"]);
$tagcloud4=make_safe($_POST["tagcloud4"]);
$tagcloud5=make_safe($_POST["tagcloud5"]);

$oldtagcloud1=make_safe($_POST["oldtagcloud1"]);
$oldtagcloud2=make_safe($_POST["oldtagcloud2"]);
$oldtagcloud3=make_safe($_POST["oldtagcloud3"]);
$oldtagcloud4=make_safe($_POST["oldtagcloud4"]);
$oldtagcloud5=make_safe($_POST["oldtagcloud5"]);



$entitle=make_safe($_POST["entitle"]);
//$addtime=make_safe($_POST["addtime"]);
$lb=make_safe($_POST["lb"]);
$addtime=$data2;
$addtime2=$data3;
$edittime=$data2;
$editname=$_SESSION["username2"];
$user=make_safe($_POST["user"]);
$content=$_POST["content"];
$encontent=$_POST["encontent"];
$c1=make_safe($_POST["c1"]);
if($c1==""){$c1=0;}
$c2=make_safe($_POST["c2"]);
if($c2==""){$c2=0;}
$c3=make_safe($_POST["c3"]);
if($c3==""){$c3=0;}
$c4=make_safe($_POST["c4"]);
if($c4==""){$c4=0;}
$c5=make_safe($_POST["c5"]);
if($c5==""){$c5=0;}
$c6=make_safe($_POST["c6"]);
if($c6==""){$c6=0;}
$c7=make_safe($_POST["c7"]);
if($c7==""){$c7=0;}
$c8=make_safe($_POST["c8"]);
if($c8==""){$c8=0;}
$c9=make_safe($_POST["c9"]);
if($c9==""){$c9=0;}

$addname=make_safe($_POST["addname"]);
if($addname==""){
$addname=$_SESSION["username2"];
}


$oldimages=make_safe($_POST["oldimages"]);
$oldimages2=make_safe($_POST["oldimages2"]);
$oldimages3=make_safe($_POST["oldimages3"]);
$oldimages4=make_safe($_POST["oldimages4"]);
$oldimages5=make_safe($_POST["oldimages5"]);
$oldimages6=make_safe($_POST["oldimages6"]);
$oldimages7=make_safe($_POST["oldimages7"]);
$oldimages8=make_safe($_POST["oldimages8"]);


include("check.php");




$path = 'upfiles/'. $_FILES['images']['name'];
$type=strstr($path,'.');
$path2 ='upfiles/'.$data."-1".$type;

$path3 = 'upfiles/'. $_FILES['images2']['name'];
$type3=strstr($path3,'.');
$path4 ='upfiles/'.$data."-2".$type3;

$path5 = 'upfiles/'. $_FILES['images3']['name'];
$type5=strstr($path5,'.');
$path6 ='upfiles/'.$data."-3".$type5;

$path7 = 'upfiles/'. $_FILES['images4']['name'];
$type7=strstr($path7,'.');
$path8 ='upfiles/'.$data."-4".$type7;

$path9 = 'upfiles/'. $_FILES['images5']['name'];
$type9=strstr($path9,'.');
$path10 ='upfiles/'.$data."-5".$type9;

$path11 = 'upfiles/'. $_FILES['images6']['name'];
$type11=strstr($path11,'.');
$path12 ='upfiles/'.$data."-6".$type11;

$path13 = 'upfiles/'. $_FILES['images7']['name'];
$type13=strstr($path13,'.');
$path14 ='upfiles/'.$data."-7".$type13;

$path15 = 'upfiles/'. $_FILES['images8']['name'];
$type15=strstr($path15,'.');
$path16 ='upfiles/'.$data."-8".$type15;



$type=strtolower($type); 
$type3=strtolower($type3); 
$type5=strtolower($type5); 
$type7=strtolower($type7); 
$type9=strtolower($type9); 
$type11=strtolower($type11); 
$type13=strtolower($type13);
$type15=strtolower($type15);


 


//修改数据
if($action=="xiugai"){

if($type==".jpg"  or $type==".jpge" or $type==".gif" or $type==".doc" or $type==".xls" or $type==".bmp" or $type==".pdf" ){
move_uploaded_file($_FILES['images']['tmp_name'],$path2);//上传图片

$aa=getimagesize($path2);
$weight=$aa["0"];////获取图片的宽
$height=$aa["1"];///获取图片的高
if($weight>=$height){$weight1=115;$height1=115*$height/$weight;}
if($height>=$weight){$height1=115;$weight1=115*$weight/$height;}

$t = new ThumbHandler();
$t->setSrcImg($path2);
    $t->setCutType(1);//这一句就OK了
    $t->setDstImg("pic/".$path2);
    $t->createImg(115,115);


$aa=getimagesize($path2);
$weight=$aa["0"];////获取图片的宽
$height=$aa["1"];///获取图片的高
//if($weight>=$height){$weight1=600;$height1=600*$height/$weight;}
//if($height>=$weight){$height1=400;$weight1=400*$weight/$height;}
$height1=400;$weight1=400*$weight/$height;
if($lb==2){
$resizeimage = new resizeimage($path2, "368", "552", "0","big/".$path2);
}
else
{
$resizeimage = new resizeimage($path2, $weight1, $height1, "0","big/".$path2);
}
if($path2 !='upfiles/'.$data."-1"){unlink($path2);}
if($oldimages!=""){unlink("pic/".$oldimages);unlink("big/".$oldimages);}//删除旧图片

}
else
{
$path2=$oldimages;
}

if($type3==".jpg"  or $type3==".jpge" or $type3==".gif" or $type3==".doc" or $type3==".xls" or $type3==".bmp" or $type3==".pdf" ){
move_uploaded_file($_FILES['images2']['tmp_name'],$path4);//上传图片

$aa=getimagesize($path4);
$weight=$aa["0"];////获取图片的宽
$height=$aa["1"];///获取图片的高
if($weight>=$height){$weight1=115;$height1=115*$height/$weight;}
if($height>=$weight){$height1=115;$weight1=115*$weight/$height;}

$t = new ThumbHandler();
$t->setSrcImg($path4);
    $t->setCutType(1);//这一句就OK了
    $t->setDstImg("pic/".$path4);
    $t->createImg(115,115);


$aa=getimagesize($path4);
$weight=$aa["0"];////获取图片的宽
$height=$aa["1"];///获取图片的高
//if($weight>=$height){$weight1=600;$height1=600*$height/$weight;}
//if($height>=$weight){$height1=400;$weight1=400*$weight/$height;}
$height1=400;$weight1=400*$weight/$height;
if($lb==2){
$resizeimage = new resizeimage($path4, "368", "552", "0","big/".$path4);
}
else
{
$resizeimage = new resizeimage($path4, $weight1, $height1, "0","big/".$path4);
}
if($path4!='upfiles/'.$data."-2"){unlink($path4);}
if($oldimages2!=""){unlink($oldimages2);unlink("pic/".$oldimages2);unlink("big/".$oldimages2);}//删除旧图片

}
else
{
$path4=$oldimages2;
}
 
if($type5==".jpg"  or $type5==".jpge" or $type5==".gif" or $type5==".doc" or $type5==".xls" or $type5==".bmp" or $type5==".pdf" ){
move_uploaded_file($_FILES['images3']['tmp_name'],$path6);//上传图片

$aa=getimagesize($path6);
$weight=$aa["0"];////获取图片的宽
$height=$aa["1"];///获取图片的高
if($weight>=$height){$weight1=115;$height1=115*$height/$weight;}
if($height>=$weight){$height1=115;$weight1=115*$weight/$height;}

$t = new ThumbHandler();
$t->setSrcImg($path6);
    $t->setCutType(1);//这一句就OK了
    $t->setDstImg("pic/".$path6);
    $t->createImg(115,115);


$aa=getimagesize($path6);
$weight=$aa["0"];////获取图片的宽
$height=$aa["1"];///获取图片的高
//if($weight>=$height){$weight1=600;$height1=600*$height/$weight;}
//if($height>=$weight){$height1=400;$weight1=400*$weight/$height;}
$height1=400;$weight1=400*$weight/$height;
if($lb==2){
$resizeimage = new resizeimage($path6, "368", "552", "0","big/".$path6);
}
else
{
$resizeimage = new resizeimage($path6, $weight1, $height1, "0","big/".$path6);
}
if($path6 !='upfiles/'.$data."-3"){unlink($path6);}
if($oldimages3!=""){unlink($oldimages3);unlink("pic/".$oldimages3);unlink("big/".$oldimages3);}//删除旧图片

}
else
{
$path6=$oldimages3;
}

if($type7==".jpg"  or $type7==".jpge" or $type7==".gif" or $type7==".doc" or $type7==".xls" or $type7==".bmp" or $type7==".pdf" ){
move_uploaded_file($_FILES['images4']['tmp_name'],$path8);//上传图片

$aa=getimagesize($path8);
$weight=$aa["0"];////获取图片的宽
$height=$aa["1"];///获取图片的高

if($weight>=$height){$weight1=115;$height1=115*$height/$weight;}
if($height>=$weight){$height1=115;$weight1=115*$weight/$height;}

$t = new ThumbHandler();
$t->setSrcImg($path8);
    $t->setCutType(1);//这一句就OK了
    $t->setDstImg("pic/".$path8);
    $t->createImg(115,115);


$aa=getimagesize($path8);
$weight=$aa["0"];////获取图片的宽
$height=$aa["1"];///获取图片的高
//if($weight>=$height){$weight1=600;$height1=600*$height/$weight;}
//if($height>=$weight){$height1=400;$weight1=400*$weight/$height;}
$height1=400;$weight1=400*$weight/$height;
if($lb==2){
$resizeimage = new resizeimage($path8, "368", "552", "0","big/".$path8);
}
else
{
$resizeimage = new resizeimage($path8, $weight1, $height1, "0","big/".$path8);
}
if($path8 !='upfiles/'.$data."-4"){unlink($path8);}
if($oldimages4!=""){unlink($oldimages4);unlink("pic/".$oldimages4);unlink("big/".$oldimages4);}//删除旧图片

}
else
{
$path8=$oldimages4;
}

if($type9==".jpg"  or $type9==".jpge" or $type9==".gif" or $type9==".doc" or $type9==".xls" or $type9==".bmp" or $type9==".pdf" ){
move_uploaded_file($_FILES['images5']['tmp_name'],$path10);//上传图片


$aa=getimagesize($path10);
$weight=$aa["0"];////获取图片的宽
$height=$aa["1"];///获取图片的高
if($weight>=$height){$weight1=115;$height1=115*$height/$weight;}
if($height>=$weight){$height1=115;$weight1=115*$weight/$height;}

$t = new ThumbHandler();
$t->setSrcImg($path10);
    $t->setCutType(1);//这一句就OK了
    $t->setDstImg("pic/".$path10);
    $t->createImg(115,115);



$aa=getimagesize($path10);
$weight=$aa["0"];////获取图片的宽
$height=$aa["1"];///获取图片的高
//if($weight>=$height){$weight1=600;$height1=600*$height/$weight;}
//if($height>=$weight){$height1=400;$weight1=400*$weight/$height;}
$height1=400;$weight1=400*$weight/$height;
if($lb==2){
$resizeimage = new resizeimage($path10, "368", "552", "0","big/".$path10);
}
else
{
$resizeimage = new resizeimage($path10, $weight1, $height1, "0","big/".$path10);
}
if($path10 !='upfiles/'.$data."-5"){unlink($path10);}
if($oldimages5!=""){unlink($oldimages5);unlink("pic/".$oldimages5);unlink("big/".$oldimages5);}//删除旧图片

}
else
{
$path10=$oldimages5;
}

if($type11==".jpg"  or $type11==".jpge" or $type11==".gif" or $type11==".doc" or $type11==".xls" or $type11==".bmp" or $type11==".pdf" ){
move_uploaded_file($_FILES['images6']['tmp_name'],$path12);//上传图片

$aa=getimagesize($path12);
$weight=$aa["0"];////获取图片的宽
$height=$aa["1"];///获取图片的高
if($weight>=$height){$weight1=115;$height1=115*$height/$weight;}
if($height>=$weight){$height1=115;$weight1=115*$weight/$height;}

$t = new ThumbHandler();
$t->setSrcImg($path12);
    $t->setCutType(1);//这一句就OK了
    $t->setDstImg("pic/".$path12);
    $t->createImg(115,115);


$aa=getimagesize($path12);
$weight=$aa["0"];////获取图片的宽
$height=$aa["1"];///获取图片的高
//if($weight>=$height){$weight1=600;$height1=600*$height/$weight;}
//if($height>=$weight){$height1=400;$weight1=400*$weight/$height;}
$height1=400;$weight1=400*$weight/$height;
if($lb==2){
$resizeimage = new resizeimage($path12, "368", "552", "0","big/".$path12);
}
else
{
$resizeimage = new resizeimage($path12, $weight1, $height1, "0","big/".$path12);
}
if($path12 !='upfiles/'.$data."-6"){unlink($path12);}
if($oldimages6!=""){unlink($oldimages6);unlink("pic/".$oldimages6);unlink("big/".$oldimages6);}//删除旧图片
}
else
{
$path12=$oldimages6;
}
 
if($type13==".jpg"  or $type13==".jpge" or $type13==".gif" or $type13==".doc" or $type13==".xls" or $type13==".bmp" or $type13==".pdf" ){
move_uploaded_file($_FILES['images7']['tmp_name'],$path14);//上传图片
$resizeimage = new resizeimage($path14, "200", "100", "0","pic/".$path14);
if($path14 !='upfiles/'.$data."-7"){unlink($path14);}
if($oldimages7!=""){unlink($oldimages7);unlink("pic/".$oldimages7);}//删除旧图片
}
else
{
$path14=$oldimages7;
}

if($type15==".jpg"  or $type15==".jpge" or $type15==".gif" or $type15==".doc" or $type15==".xls" or $type15==".bmp" or $type15==".pdf" ){
move_uploaded_file($_FILES['images8']['tmp_name'],$path16);//上传图片
$resizeimage = new resizeimage($path16, "200", "100", "0","pic/".$path16);
if($oldimages8!=""){unlink($oldimages8);unlink("pic/".$oldimages8);}//删除旧图片
}
else
{
$path16=$oldimages8;
}

if($tagcloud1!=""){
$sql=mysql_query("select * from tagcloud where title = '$tagcloud1'");
$result=mysql_fetch_array($sql);
if ($result!=false){
$query=mysql_query("update tagcloud set title='$tagcloud1' where title='$oldtagcloud1'");	
}
else
{
$sql="Insert Into tagcloud (title) Values('$tagcloud1')";
$result=mysql_query($sql);
}
}

if($tagcloud2!=""){
$sql=mysql_query("select * from tagcloud where title = '$tagcloud2'");
$result=mysql_fetch_array($sql);
if ($result!=false){
$query=mysql_query("update tagcloud set title='$tagcloud2' where title='$oldtagcloud2'");	
}
else
{
$sql="Insert Into tagcloud (title) Values('$tagcloud2')";
$result=mysql_query($sql);
}
}

if($tagcloud3!=""){
$sql=mysql_query("select * from tagcloud where title = '$tagcloud3'");
$result=mysql_fetch_array($sql);
if ($result!=false){
$query=mysql_query("update tagcloud set title='$tagcloud3' where title='$oldtagcloud3'");	
}
else
{
$sql="Insert Into tagcloud (title) Values('$tagcloud3')";
$result=mysql_query($sql);
}
}

if($tagcloud4!=""){
$sql=mysql_query("select * from tagcloud where title = '$tagcloud4'");
$result=mysql_fetch_array($sql);
if ($result!=false){
$query=mysql_query("update tagcloud set title='$tagcloud4' where title='$oldtagcloud4'");	
}
else
{
$sql="Insert Into tagcloud (title) Values('$tagcloud4')";
$result=mysql_query($sql);
}
}

if($tagcloud5!=""){
$sql=mysql_query("select * from tagcloud where title = '$tagcloud5'");
$result=mysql_fetch_array($sql);
if ($result!=false){
$query=mysql_query("update tagcloud set title='$tagcloud5' where title='$oldtagcloud5'");	
}
else
{
$sql="Insert Into tagcloud (title) Values('$tagcloud5')";
$result=mysql_query($sql);
}
}





if($query=mysql_query("update ".$webname." set c1='$c1',c2='$c2',c3='$c3',c4='$c4',c5='$c5',c6='$c6',c7='$c7',c8='$c8',c9='$c9',title='$title',tagcloud1='$tagcloud1',tagcloud2='$tagcloud2',tagcloud3='$tagcloud3',tagcloud4='$tagcloud4',tagcloud5='$tagcloud5',entitle='$entitle',BigClassName='$BigClassName',BigClassName2='$BigClassName2',BigClassName3='$BigClassName3',BigClassName4='$BigClassName4',BigClassName5='$BigClassName5',lb='$lb',enBigClassName='$enBigClassName',SmallClassName='$SmallClassName',enSmallClassName='$enSmallClassName',content='$content',encontent='$encontent',edittime='$addtime',editname='$editname',addname='$addname',images='$path2',images2='$path4',images3='$path6',images4='$path8',images5='$path10',images6='$path12',images7='$path14',images8='$path16' where id='$id'"))

{
   echo "<script>alert('資料修改成功！');window.location.href='".$linkname.".php?page=".$page."';</script>";
 }
 
 else
  {
   echo "<script>alert('資料修改失敗！');window.location.href='".$linkname.".php?page=".$page."';</script>";
  }
}





if($action=="del_images"){

if($value_images=="images"){
$query=mysql_query("update ".$webname." set images='' where id='$id'");
if($del_value!=""){unlink($del_value);unlink("pic/".$del_value);unlink("big/".$del_value);}//删除旧图片
}

if($value_images=="images2"){
$query=mysql_query("update ".$webname." set images2='' where id='$id'");
if($del_value!=""){unlink($del_value);unlink("pic/".$del_value);unlink("big/".$del_value);}//删除旧图片
}

if($value_images=="images3"){
$query=mysql_query("update ".$webname." set images3='' where id='$id'");
if($del_value!=""){unlink($del_value);unlink("pic/".$del_value);unlink("big/".$del_value);}//删除旧图片
}

if($value_images=="images4"){
$query=mysql_query("update ".$webname." set images4='' where id='$id'");
if($del_value!=""){unlink($del_value);unlink("pic/".$del_value);unlink("big/".$del_value);}//删除旧图片
}

if($value_images=="images5"){
$query=mysql_query("update ".$webname." set images5='' where id='$id'");
if($del_value!=""){unlink($del_value);unlink("pic/".$del_value);unlink("big/".$del_value);}//删除旧图片
}

if($value_images=="images6"){
$query=mysql_query("update ".$webname." set images6='' where id='$id'");
if($del_value!=""){unlink($del_value);unlink("pic/".$del_value);unlink("big/".$del_value);}//删除旧图片
}


}
?>
 
 
 
 
 
 
 
 
 
 
 
 <script language="javascript"> 



function Checker(){ 


  
// document.write(document.form1.id.length)
  
  
  
   //if(document.form1.yaoyun.value==""){document.write("您按了确认！") }
   
   //  document.write("您按了确认！") 

   

document.form1.items.value = "";         //设置隐藏域的值为空
if ( !document.form1.tagcloud.length ) {      //只有一个复选框，form1.item.length = undefined



	if ( document.form1.tagcloud.checked ){
	document.form1.items.value = document.form1.tagcloud.value; 
	
	
	} 
}else { 

	var temp="";
	for ( i = 0 ; i < document.form1.tagcloud.length ; i++ ){ 
		if ( document.form1.tagcloud[i].checked ){       //复选框中有选中的框 
			temp=temp+document.form1.tagcloud[i].value+",";   //将数组中的元素使用","分隔
		}	 

	} 
	temp=temp.substring(0,temp.length-1);     //去除字符串末尾多余的","
	document.form1.items.value = temp;    //将变量赋值给隐藏域
	
//	document.write(document.form1.items.value)
} 
} 
</script>  

<script language="javascript">
function CheckAll(elementsA,elementsB)
{
	var len = elementsA;
	if(len.length > 0)
	{
		for(i=0;i<len.length;i++)
		{
			elementsA[i].checked = true;
		}
		if(elementsB.checked ==false)
		{
			for(j=0;j<len.length;j++)
			{
				elementsA[j].checked = false;
			}
		}
	}
	else
	{
		len.checked = true;
		if(elementsB.checked == false)
		{
			len.checked = false;
		}
	}
}
</script>
 
 
<?PHP
 	$id=make_safe($_GET["id"]);	 
    $sql="select * from news where id='$id' order by id desc";			
	$result=mysql_query($sql);
	while ($row=mysql_fetch_object($result)){
?>
 <div id="contact-add">
 
 <form method="post" enctype="multipart/form-data" name="form1" onSubmit="Checker()" action="?action=xiugai&id=<?php echo $row->id;?>" target="_self">
   <table border="0" cellpadding="0" cellspacing="0" >
     <tr>
       <td>文章標題：
         <label for="textfield2"></label>
         <input name="title" type="text" class="contact_add-tit-keyin"  value="<?php echo $row->title;?>" /></td>
     </tr>
     <tr>
       <td><ul>
         <li>選擇分類：</li>
		 
		 <?php if($_SESSION["box11"]==1 or $_SESSION["box22"]==1 or $_SESSION["box33"]==1 or $_SESSION["a11"]==1){?>
         <li>		 
           <input type="radio" name="BigClassName"  value="Flavor" <?php if($row->BigClassName=="Flavor"){echo  "checked='checked'";}?> onclick="check_aid('a1')" />Flavor </li>
		 <?php }?>  
		   <?php if($_SESSION["box11"]==1 or $_SESSION["box22"]==1 or $_SESSION["box33"]==1 or $_SESSION["a22"]==1){?> 
         <li>
           <input type="radio" name="BigClassName" value="Trend" <?php if($row->BigClassName=="Trend"){echo  "checked='checked'";}?> onclick="check_aid('a2')" />Trend </li>
		<?php }?>   
		   
		 <?php if($_SESSION["box11"]==1 or $_SESSION["box22"]==1 or $_SESSION["box33"]==1 or $_SESSION["a33"]==1){?>  
         <li>
           <input onclick="check_aid('a3')" type="radio" name="BigClassName" value="City" <?php if($row->BigClassName=="City"){echo  "checked='checked'";}?> />City </li>
		<?php }?>   
		   
		<?php if($_SESSION["box11"]==1 or $_SESSION["box22"]==1 or $_SESSION["box33"]==1 or $_SESSION["a44"]==1){?>   
         <li>
           <input type="radio" name="BigClassName" value="Traveling" <?php if($row->BigClassName=="Traveling"){echo  "checked='checked'";}?> onclick="check_aid('a4')" /> Traveling </li>
		   <?php }?>
		   
		   <?php if($_SESSION["box11"]==1 or $_SESSION["box22"]==1 or $_SESSION["box33"]==1 or $_SESSION["a55"]==1){?>
         <li>
           <input type="radio" name="BigClassName" value="Opinion" <?php if($row->BigClassName=="Opinion"){echo  "checked='checked'";}?> onclick="check_aid('a5')" />          
           Opinion</li>
		   <?php }?>
		   
		   <?php if($_SESSION["box11"]==1 or $_SESSION["box22"]==1 or $_SESSION["box33"]==1 or $_SESSION["a66"]==1){?>
		    <li>
           <input type="radio" name="BigClassName" value="collection" <?php if($row->BigClassName=="collection"){echo  "checked='checked'";}?> onclick="check_aid('a6')" />          
           collection</li>
		   <?php }?>
		   
		    <?php if($_SESSION["box11"]==1 or $_SESSION["box22"]==1 or $_SESSION["box33"]==1 or $_SESSION["a77"]==1){?>
		    <li>
           <input type="radio" name="BigClassName" value="DOWNLOAD" <?php if($row->BigClassName=="DOWNLOAD"){echo  "checked='checked'";}?> onclick="check_aid('a7')" />          
           DOWNLOAD</li>
		   <?php }?>
       </ul></td>
     </tr>
     <tr>
       <td><ul>
         <li>第二分類：</li>
		 
		 <li>
           <input name="BigClassName2" type="radio" value="0" <?php if($row->BigClassName2==0){echo "checked='checked'";}?> />           
           無</li>
		 
		 
         <li>
           <input name="BigClassName2" type="radio" value="1" <?php if($row->BigClassName2==1){echo "checked='checked'";}?> />           
           NEWS</li>
		   
         <li>
           <input type="radio" name="BigClassName2" value="2" <?php if($row->BigClassName2==2){echo "checked='checked'";}?> />          
           FEATURES</li>
		   
         <li>
           <input type="radio" name="BigClassName2" value="3" <?php if($row->BigClassName2==3){echo "checked='checked'";}?> />         
           COLUMNS</li>
		   
		 <li>
           <input type="radio" name="BigClassName2" value="4" <?php if($row->BigClassName2==4){echo "checked='checked'";}?> />     
           EVENTS</li>
		   
		  <li>
           <input type="radio" name="BigClassName2" value="5" <?php if($row->BigClassName2==5){echo "checked='checked'";}?> />       
           DOWNLOAD</li>
		
       </ul></td>
     </tr>
     <tr>
       <td><ul>
         <li>文章格式：</li>
         <li>
           <input type="radio" name="lb"  value="1" <?php if($row->lb=="1"){echo  "checked='checked'";}?> />
           橫圖較多格式</li>
         <li>
           <input type="radio" name="lb" value="2"  <?php if($row->lb=="2"){echo  "checked='checked'";}?>/>
           直圖格式</li>
       </ul></td>
     </tr>
	 
	 
	  <?php if($_SESSION["box11"]==1 or $_SESSION["box22"]==1 or $_SESSION["box33"]==1 ){?>
	 <tr>
       <td>
       <ul>
    <li>文章作者：</li>
    <li>
           <input name="addname" type="radio" value="" checked="checked" />           
           無</li>
		 </ul>   
	
	
	 <ul id="a1" style="display:<?php if($row->BigClassName=="Flavor"){echo  "block";}else{echo "none";}?>">
	<?php 
$n=1;
$sql2="select  id,box4,username,name,a1 from guanli where box4='1' and a1='1'   order by id desc ";			
	$result2=mysql_query($sql2);
	while ($row2=mysql_fetch_object($result2)){
	?>	   
    <li>
 <input type="radio" name="addname" value="<?php echo $row2->username;?>"  <?php if($row->addname==$row2->username){echo "checked='checked'";}?>/>     
      <?php echo $row2->name;?></li>
    <?php }?>
	 </ul>
	
	
	 <ul id="a2" style="display:<?php if($row->BigClassName=="Trend"){echo  "block";}else{echo "none";}?>">
		<?php 
$n=1;
$sql2="select  id,box4,username,name,a2 from guanli where box4='1' and a2='1'   order by id desc ";			
	$result2=mysql_query($sql2);
	while ($row2=mysql_fetch_object($result2)){
	?>	   
    <li>
      <input type="radio" name="addname" value="<?php echo $row2->username;?>" <?php if($row->addname==$row2->username){echo "checked='checked'";}?> />     
      <?php echo $row2->name;?></li>
    <?php }?>
	 </ul>
	
	
	
	
	
	
	 <ul id="a3" style="display:<?php if($row->BigClassName=="City"){echo  "block";}else{echo "none";}?>">
		<?php 
$n=1;
$sql2="select  id,box4,username,name,a3 from guanli where box4='1' and a3='1'   order by id desc ";			
	$result2=mysql_query($sql2);
	while ($row2=mysql_fetch_object($result2)){
	?>	   
    <li>
      <input type="radio" name="addname" value="<?php echo $row2->username;?>" <?php if($row->addname==$row2->username){echo "checked='checked'";}?> />     
      <?php echo $row2->name;?></li>
    <?php }?>
	 </ul>
	
	
	
	 <ul id="a4" style="display:<?php if($row->BigClassName=="Traveling"){echo  "block";}else{echo "none";}?>">
		<?php 
$n=1;
$sql2="select  id,box4,username,name,a4 from guanli where box4='1' and a4='1'   order by id desc ";			
	$result2=mysql_query($sql2);
	while ($row2=mysql_fetch_object($result2)){
	?>	   
    <li>
      <input type="radio" name="addname" value="<?php echo $row2->username;?>" <?php if($row->addname==$row2->username){echo "checked='checked'";}?> />     
      <?php echo $row2->name;?></li>
    <?php }?>
	 </ul>
	
	
	 <ul id="a5" style="display:<?php if($row->BigClassName=="Opinion"){echo  "block";}else{echo "none";}?>">
		<?php 
$n=1;
$sql2="select  id,box4,username,name,a5 from guanli where box4='1' and a5='1'   order by id desc ";			
	$result2=mysql_query($sql2);
	while ($row2=mysql_fetch_object($result2)){
	?>	   
    <li>
      <input type="radio" name="addname" value="<?php echo $row2->username;?>"  <?php if($row->addname==$row2->username){echo "checked='checked'";}?>/>     
      <?php echo $row2->name;?></li>
    <?php }?>
	 </ul>
	
	
	 <ul id="a6" style="display:<?php if($row->BigClassName=="collection"){echo  "block";}else{echo "none";}?>">
		<?php 
$n=1;
$sql2="select  id,box4,username,name,a6 from guanli where box4='1' and a6='1'   order by id desc ";			
	$result2=mysql_query($sql2);
	while ($row2=mysql_fetch_object($result2)){
	?>	   
    <li>
      <input type="radio" name="addname" value="<?php echo $row2->username;?>" <?php if($row->addname==$row2->username){echo "checked='checked'";}?> />     
      <?php echo $row2->name;?></li>
    <?php }?>
	 </ul>
	
	
	 <ul id="a7" style="display:<?php if($row->BigClassName=="DOWNLOAD"){echo  "block";}else{echo "none";}?>">
		<?php 
$n=1;
$sql2="select  id,box4,username,name,a7 from guanli where box4='1' and a7='1'   order by id desc ";			
	$result2=mysql_query($sql2);
	while ($row2=mysql_fetch_object($result2)){
	?>	   
    <li>
      <input type="radio" name="addname" value="<?php echo $row2->username;?>" <?php if($row->addname==$row2->username){echo "checked='checked'";}?> />     
      <?php echo $row2->name;?></li>
    <?php }?>
	
	
	
  </ul>
       </td>
     </tr>
	 <?php }?>
	 
	 
	 
	 
   </table>
   <table border="0" cellpadding="0" cellspacing="0" >
   <tr>
     <td>新增圖片：     </td>
   </tr>
   <tr>
     <td  class="contact_add-upload">圖片1：
       <input name="images" type="file" size="50"  />
       <input type="hidden" name="oldimages" value="<?php echo $row->images;?>" />
       <?php if($row->images!=""){?>
       <img src="<?php echo "pic/".$row->images;?>" width="52"  align="top" />  
	   <a href="?action=del_images&id=<?php echo $row->id;?>&value_images=images&del_value=<?php echo $row->images;?>">刪除</a>
	        <?php }?></td>
   </tr>
   <tr>
     <td class="contact_add-upload">圖片2：
       <input name="images2" type="file" size="50"  />
	   <input type="hidden" name="oldimages2" value="<?php echo $row->images2;?>" />
       <?php if($row->images2!=""){?><img src="<?php echo "pic/".$row->images2;?>" width="52"  align="top" />
	   <a href="?action=del_images&id=<?php echo $row->id;?>&value_images=images2&del_value=<?php echo $row->images2;?>">刪除</a>
	   <?php }?></td>
   </tr>
   <tr>
     <td class="contact_add-upload">圖片3：
       <input name="images3" type="file" size="50" />
	   <input type="hidden" name="oldimages3" value="<?php echo $row->images3;?>" />
	   <?php if($row->images3!=""){?><img src="<?php echo "pic/".$row->images3;?>" width="52"  align="top" />
	   <a href="?action=del_images&id=<?php echo $row->id;?>&value_images=images3&del_value=<?php echo $row->images3;?>">刪除</a>	
	      <?php }?></td>
   </tr>
   <tr>
     <td class="contact_add-upload">圖片4：
       <input name="images4" type="file" size="50"  />
	   <input type="hidden" name="oldimages4" value="<?php echo $row->images4;?>" />
       <?php if($row->images4!=""){?><img src="<?php echo "pic/".$row->images4;?>" width="52"  align="top" />
	   <a href="?action=del_images&id=<?php echo $row->id;?>&value_images=images4&del_value=<?php echo $row->images4;?>">刪除</a>
	   <?php }?></td>
   </tr>
   <tr>
     <td class="contact_add-upload">圖片5：
       <input name="images5" type="file" size="50" />
	   <input type="hidden" name="oldimages5" value="<?php echo $row->images5;?>" />
	   <?php if($row->images5!=""){?><img src="<?php echo "pic/".$row->images5;?>" width="52"  align="top" />
	   <a href="?action=del_images&id=<?php echo $row->id;?>&value_images=images5&del_value=<?php echo $row->images5;?>">刪除</a>
	   <?php }?></td>
   </tr>
   <tr>
     <td class="contact_add-upload">圖片6：
       <input name="images6" type="file" size="50"  />
	   <input type="hidden" name="oldimages6" value="<?php echo $row->images6;?>" />
	  <?php if($row->images6!=""){?> <img src="<?php echo "pic/".$row->images6;?>" width="52"  align="top" />
	  <a href="?action=del_images&id=<?php echo $row->id;?>&value_images=images6&del_value=<?php echo $row->images6;?>">刪除</a>
	  <?php }?></td>
   </tr>
 </table>
 <table border="0" cellpadding="0" cellspacing="0" >
   <tr>
     <td>編輯內容： </td>
   </tr>
   <tr>
     <td><?php 
include('../fckeditor/fckeditor.php');
	$oFCKeditor = new FCKeditor('FCKeditor1')  ; 
	$oFCKeditor->BasePath = '../fckeditor/' ;    
	$oFCKeditor->ToolbarSet = 'Default' ; 
	$oFCKeditor->InstanceName = 'content' ; 
	$oFCKeditor->Width = '100%' ; 
	$oFCKeditor->Height = '400' ; 
	//$oFCKeditor->Value  = $row['content']; 
	$oFCKeditor->Value  = $row->content; 
$oFCKeditor->Create();?></td>
   </tr>
  
 </table>
 
 
 

 
 
  <table border="0" cellpadding="0" cellspacing="0" >
   
   <tr>
     <td><img src="../images/html-edit.gif" width="800" height="309" /></td>
   </tr>
   <tr>
     <td><a href="news2_manage.php?newsid=<?php echo $row->id;?>&title=<?php echo urlencode($row->title);?>">分頁管理</a> </td>
   </tr>
 </table>
 
 
 
 <?PHP
 $n=1;
    $sql2="select * from news2 where newsid='".$row->id."' order by id ";			
	$result2=mysql_query($sql2);
	while ($row2=mysql_fetch_object($result2)){
?>
  <table border="0" cellpadding="0" cellspacing="0" > 
   <tr>
     <td >分頁<?php echo $n;?></td>
     <td ><?php echo utf8substr($row2->content,0,100);?><?php if(strlen($row2->content)>100){echo "......";}?></td>
   </tr>
 </table>
 <?php 
 $n=$n+1;
 }?>
 
 
 
 <table border="0" cellpadding="0" cellspacing="0" >
   <tr>
     <td>標簽雲（關鍵字）設定： </td>
   </tr>
   <tr>
     <td><ul>
       <li>
         <label for="textfield3"></label>
         <input name="tagcloud1" type="text" class="contact_tagcloud" id="textfield3" value="<?php echo $row->tagcloud1;?>" />
		  <input type="hidden" name="oldtagcloud1" value="<?php echo $row->tagcloud1;?>" />
       </li>
       <li>
         <label for="textfield3"></label>
         <input name="tagcloud2" type="text" class="contact_tagcloud" id="textfield3" value="<?php echo $row->tagcloud2;?>" />
		 <input type="hidden" name="oldtagcloud2" value="<?php echo $row->tagcloud2;?>" />
       </li>
       <li>
         <label for="textfield3"></label>
         <input name="tagcloud3" type="text" class="contact_tagcloud" id="textfield3" value="<?php echo $row->tagcloud3;?>" />
		 <input type="hidden" name="oldtagcloud3" value="<?php echo $row->tagcloud3;?>" />
		 
       </li>
       <li>
         <label for="textfield3"></label>
         <input name="tagcloud4" type="text" class="contact_tagcloud" id="textfield3" value="<?php echo $row->tagcloud4;?>" />
		 <input type="hidden" name="oldtagcloud4" value="<?php echo $row->tagcloud4;?>" />
       </li>
       <li>
         <label for="textfield3"></label>
         <input name="tagcloud5" type="text" class="contact_tagcloud" id="textfield3" value="<?php echo $row->tagcloud5;?>" />
		 <input type="hidden" name="oldtagcloud5" value="<?php echo $row->tagcloud5;?>" />
       </li>
     </ul></td>
   </tr>
 </table>
 
 
 
 
 

 <table border="0" cellspacing="0" cellpadding="0" >
   <tr>
     <td>延伸閱讀選擇區塊：</td>
   </tr>
   <tr>
     <td><ul>
       <li>選擇分類：</li>
       <li>
         <input name="c1" type="checkbox" id="checkbox2" value="1" <?php if($row->c1==1){echo "checked='checked'";}?> />
        All</li>
		
       <li>
         <input type="checkbox" name="c2" id="checkbox2" value="1" <?php if($row->c2==1){echo "checked='checked'";}?> />
 Flavor </li>
		 
       <li>
         <input type="checkbox" name="c3" id="checkbox2" value="1" <?php if($row->c3==1){echo "checked='checked'";}?> />
  Trend </li>
		 
       <li>
         <input type="checkbox" name="c4" id="checkbox2" value="1" <?php if($row->c4==1){echo "checked='checked'";}?> />
  City </li>
  
       <li>
         <input type="checkbox" name="c5" id="checkbox2" value="1" <?php if($row->c5==1){echo "checked='checked'";}?> />
   Traveling </li>
		 
		 
		 <li>
         <input type="checkbox" name="c6" id="checkbox2" value="1" <?php if($row->c6==1){echo "checked='checked'";}?> />
   Opinion </li>
		 
       <li>
         <input type="checkbox" name="c7" id="checkbox2" value="1" <?php if($row->c7==1){echo "checked='checked'";}?> />
    collection</li>
		 
		 
		  <li>
         <input type="checkbox" name="c8" id="checkbox2" value="1" <?php if($row->c8==1){echo "checked='checked'";}?> />
          DOWNLOAD</li>
		  
		  
		  <li>
         <input type="checkbox" name="c9" id="checkbox2" value="1" <?php if($row->c9==1){echo "checked='checked'";}?> />
          random</li>
       
		 
       </ul></td>
   </tr>
  
   </table>
   
   
   
   
   
 <table border="0" cellspacing="0" cellpadding="0" >
  <tr>
    <td>      <input type="submit" name="Submit" value="提交修改" /></td>
  </tr>
</table>
</form>


 </div>
 <?php }?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 <!-- main end //-->
</div><!--Wrap end //-->
<div id="botton">
 <?php include_once('blog_botton_btn.php');?>
</div>
</body>
</html>
